//
//  TalkfunCloudLiveLogin.h
//  CloudLive
//
//  Created by LuoLiuyou on 16/8/18.
//  Copyright © 2016年 Talkfun. All rights reserved.
//

#import <Foundation/Foundation.h>

//注册状态
typedef NS_ENUM(NSInteger,TalkfunCloudLiveRegisterType)
{
  
    TalkfunCloudLiveRegisterTypeStart        =     1,   //开始注册
    TalkfunCloudLiveRegisterTypegetRegister  =  2,      //获取是否允许注册
};

//验证码类型
typedef NS_ENUM(NSInteger,TalkfunCloudLiveCaptchaType)
{
    TalkfunCloudLiveCaptchaTypeRegister      =     1,   //app注册
    TalkfunCloudLiveCaptchaTypeCodeLogin      =     2,   // 验证码登录
    TalkfunCloudLiveCaptchaTypeChangePSW        =     3,   //注册修改密码
   
};


@interface TalkfunCloudLive : NSObject

@property (nonatomic) TalkfunCloudLiveRegisterType registerType;

+ (TalkfunCloudLive *)shared;

//获取user information(已经登录才有）
- (NSDictionary *)getUser;

- (NSString *)getUserFolder;

//登录成功后, 可获取合作方id
+(NSString*)getPartner_id;
//获取主播ID（登录过才有） 默认:@""
- (NSString *)getID;
//获取bid（登录过才有）  默认:@""
+(NSString*)getBId;

//是否是登录状态
- (BOOL)isLogin;

//根据用户名和密码登录，callback返回登录信息
//(返回的@"code"为0即登录成功。若不为0，返回的@"msg"会包含错误的信息)
- (void)login:(NSString *)username password:(NSString *)password callback:(void (^)(id result))callback;

//根据token自动登录
- (void)autoLogin:(NSString *)token callback:(void (^)(id result))callback;

//退出登录
- (void)logout:(void (^)(id result))callback;


+(void)invalidate;

/**
 注册
 phone:手机号

 */
-(void)registernumber:(NSString *)phone code:(NSString*)code password:(NSString *)password type:(TalkfunCloudLiveRegisterType)type callback:(void (^)(NSDictionary* result))callback;

/**
 发送短信验证码
 */
-(void)sendCaptcha:(NSString *)phone type:(TalkfunCloudLiveCaptchaType)type callback:(void (^)(NSDictionary* result))callback;

/**
 短信验证码登录
 */

-(void)verifyCodeLogin:(NSString *)phone code:(NSString *)code callback:(void (^)(NSDictionary* result))callback;
/**
 注销账号
 */
-(void)cancelAccount:(void (^)(NSDictionary* result))callback;

/**
 修改密码
 */

-(void)resetPassword:(NSString *)phone Code:(NSString *)code Password:(NSString *)password callback:(void (^)(NSDictionary* result))callback;

@end
